# -*- python -*-
#
#  Copyright (c) 2010-2012, Jim Bosch
#  All rights reserved.
#
#  ndarray is distributed under a simple BSD-like license;
#  see the LICENSE file that should be present in the root
#  of the source distribution, or alternately available at:
#  https://github.com/ndarray/ndarray
#
Import("env")
import os

generated = ["ndarray/ArrayRef.h",
             "ndarray/ArrayBaseN.h",
             "ndarray/operators.h",
             "ndarray/Vector.h",
             "ndarray/fft/FFTWTraits.h",
             "ndarray/bp/auto/Array.h",
             "ndarray/bp/auto/ArrayRef.h",
             "ndarray/bp/auto/Vector.h",
             "ndarray/eigen/bp/auto/EigenView.h",
             "ndarray/eigen/bp/auto/Array.h",
             "ndarray/eigen/bp/auto/Matrix.h",
             ]
m4include = Dir("../m4").abspath
m4flags = "-I%s" % m4include
headers = [env.M4(filename, "%s.m4" % filename, M4FLAGS=[m4flags]) for filename in generated]

for header in headers:
    env.Depends(header, Glob(os.path.join(m4include, "*.m4")))

headers += env.Glob("*.h")
headers += env.Glob("*/*.h")
headers += env.Glob("*/*/*.h")
headers += env.Glob("*/*/*/*.h")
headers += env.Glob("*.i")

Return("headers")
